const ab2hex = (buffer) => {
    let hexArr = Array.prototype.map.call(new Uint8Array(buffer), (bit) => {
        return ('00' + bit.toString(16)).slice(-2);
    });
    return hexArr.join('');
};
const unique = (arr, u_key) => {
    const obj = {};
    const result = [];
    arr.forEach((item) => {
        const typeof_key = typeof item[u_key] + item[u_key];
        obj[typeof_key] = item;
    });
    for (const key in obj) {
        result.push(obj[key]);
    }
    return result;
};

export default {
    ab2hex,
    unique,
};
